import scrapy


class ShuJiaSpider(scrapy.Spider):
    name = "ShuJiaSpider"

    # 爬虫入口
    def start_requests(self):
        url = "http://www.anhuisjxy.com/"

        # 发起一个http请求
        yield scrapy.Request(url=url, callback=self.parse)

    # response  响应
    def parse(self, response):
        # 获取网页内容
        print(response.text)
        # 通过xpath获取王丽里面的数据   /从根开始   // 全局查询
        print(response.xpath("/html/head/title/text()").extract())
        print(response.xpath("//title/text()").extract())
